<template>
  <div>
    <ul>
      <li v-for="item in arr" :key="item.id">
        {{ item.name }}
        <input type="text" />
      </li>
    </ul>
    <button @click="fii">新来的一个</button>
  </div>
</template>

<script>
export default {
  name: "Day3ZuoyeApp",

  data() {
    return {
      arr: [
        { id: 10, name: "老大" },
        { id: 30, name: "老二" },
        { id: 40, name: "老三" },
      ],
    };
  },

  mounted() {},

  methods: {
    fii() {
      this.arr.splice(1, 0, { id: 20, name: "老四" });
    },
  },
};
</script>

<style lang="scss" scoped>
</style>